package com.lagou;

import com.lagou.bean.Resume;
import com.lagou.repository.ResumeRepository;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.context.ApplicationContext;

import java.util.ArrayList;
import java.util.Iterator;
import java.util.List;

@SpringBootApplication
public class MongoRepositoryMain {
    public static void main(String[] args) {
        ApplicationContext  applicationContext = SpringApplication.run(MongoRepositoryMain.class,args);
        ResumeRepository  resumeRepository = applicationContext.getBean(ResumeRepository.class);
        //System.out.println(resumeRepository.findAll());
        resumeRepository.deleteAll();

        /*Resume resume  = new Resume();
        resume.setName("chengdaotest");
        resume.setExpectSalary(1);
        resume.setCity("bj");
        resumeRepository.save(resume);*/

        /*List list = new ArrayList();
        for(int i=1 ; i<=200; i++){
            Resume resume  = new Resume();
            resume.setName("test"+i);
            resume.getExpectSalary(i);
            resume.setCity("bj");
            list.add(resume);
        }
        resumeRepository.saveAll(list);*/

    }
}
